<%@page contentType="text/html; charset=UTF-8"%>
<%@taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@include file="/common/definition.jsp"%>

<html:html>
<tiles:insert beanName="admin-definition" flush="true">
	<tiles:put name="title"> Administrator Management </tiles:put>
	<tiles:put name="body" type="string">
	<div class="mainHome" style="padding-top: 15px; min-height: 360px">
		<s:form>
			<h1 class="borderBot text-center">Trang Quản lý Shop</h1>
			<div class="col-md-12">
				<table class="table table-condensed table-bordered col-md-12" id="Result">
					<thead>
						<tr>
							<th class="col-md-1">ID</th>
							<th class="col-md-1">Logo</th>
							<th class="col-md-4">Tên cửa hàng</th>
							<th class="col-md-1">Tình Trạng</th>
							<th class="col-md-1">Action</th>
						</tr>
					</thead>
					<tbody>
						<s:iterator value="profileModel.listAgent">
							<tr>
								<td class="col-md-1"><s:property value="agentID" /></td>
								<td class="text-center col-md-1"><img
									src='<s:property value="logo"/>' width="70px" height="50px">
								</td>
								<td class="col-md-4"><s:property value="agentName" /></td>
								<td class="col-md-1"><s:property value="status" />
								</td>
								<td class="col-md-1"><button type="button"
										class="btn btn-default dropdown-toggle" data-toggle="dropdown">
										Action <span class="caret"></span>
									</button>
									<ul class="dropdown-menu" role="menu" style="top: inherit">
										<li><s:a action="shopDetailByMod">Chi tiết cửa hàng<s:param
													name="agentID" value="agentID" />
											</s:a></li>
										<li><s:a action="showAllProductShop-page">Các sản phẩm của cửa hàng<s:param
													name="agentID" value="agentID" />
											</s:a></li>
										<li><s:a action="shopHome">Trang của shop
											<s:param name="agentID" value="agentID" />
											</s:a></li>
									</ul>
								</td>
							</tr>
						</s:iterator>
					</tbody>
				</table>
			</div>			
		</s:form>
		<script type="text/javascript" src="js/jquery.dataTables.js"></script>
		<script src="js/datatables.js"></script>
		<script type="text/javascript">
			$(document)
					.ready(
							function() {
								$('#Result')
										.dataTable(
												{
													"sPaginationType" : "bs_full",
													"oLanguage" : {
														"sSearch" : "",
														"sZeroRecords" : "Không có dữ liệu",
														"sEmptyTable" : "Không có dữ liệu",
														"sInfo" : "Hiển thị từ _START_ đến _END_. Tổng cộng: _TOTAL_ dòng.",
														"sInfoFiltered" : "",
														"sLengthMenu" : "Hiển thị _MENU_ Dòng",
														"sInfoEmpty" : 'Không tìm thấy dữ liệu.'
													}
												});
								$('#Result')
										.each(
												function() {
													var datatable = $(this);
													// SEARCH - Add the placeholder for Search and Turn this into in-line form control
													var search_input = datatable
															.closest(
																	'.dataTables_wrapper')
															.find(
																	'div[id$=_filter] input');
													search_input.attr(
															'placeholder',
															'Tìm Nhanh');
													search_input
															.addClass('form-control input-sm');
													// LENGTH - Inline-Form control
													var length_sel = datatable
															.closest(
																	'.dataTables_wrapper')
															.find(
																	'div[id$=_length] select');
													length_sel
															.addClass('form-control input-sm');
												});
							});
		</script>
		</div>
	</tiles:put>
</tiles:insert>
</html:html>
